package com.lotterymanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lotterymanage.dao.UserDao;
import com.lotterymanage.domain.User;
import com.lotterymanage.page.Pagination;
import com.lotterymanage.service.UserService;

/**
 * 用户service.
 * @author lxz
 * @date Apr 19, 2010
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    /**
     * 添加新用户.
     * @param user User
     */
    @Transactional
    public void add(final User user) {
        this.userDao.insert(user);
    }

    /**
     * 分页查找.
     * @param user User
     * @return Pagination
     */
    public Pagination findPage(final User user) {
        return this.userDao.selectUserPage(user);
    }
}
